import { Define, EntityObjectFactory } from 'tiny-entity2';
const EntityObjectType = EntityObjectFactory.GetEntityObjectType(process.env.dataBaseType || 'mysql');

@Define.Table({ TableName: 'tableproduct' })
export class TableProduct extends EntityObjectType<TableProduct> {
    @Define.PrimaryKey()
    id: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR,
        NotAllowNULL: true,
        IsIndex: true
    })
    storeId: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR,
        DataLength: 40
    })
    deskTableId: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR,
        DataLength: 40
    })
    productId: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR
    })
    productName: string;

    @Define.Column({
        DataType: Define.DataType.Decimal,
        DataLength: 11,
        DecimalPoint: 3,
        NotAllowNULL: true
    })
    productPrice: number;

    @Define.Column({
        DataType: Define.DataType.INT
    })
    qty: number;

    @Define.Column({
        DataType: Define.DataType.VARCHAR,
        DataLength: 20
    })
    type: string;

    @Define.Column({
        DataType: Define.DataType.BIGINT
    })
    createTime: number;

    @Define.Column({
        DataType: Define.DataType.BIGINT
    })
    version: number;
}

export const TablseProductType = {
    RoomCost: 'roomCost', // 包间费
    AutoSetting: 'autoSetting', // 根据台桌人数
    Personal: 'personalSetting' // 手动指定数量
}